package com.example.learn_android;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import androidx.annotation.Nullable;

public class BtnClick extends Activity {
    TextView text;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_btn_click);
        Button btn = findViewById(R.id.btn_clickA);
        text = findViewById(R.id.text_show);
    }

    public void doClick(View view) {
        text.setText("点击后文字展示");
        Log.d("doClick: ",((Button) view).getText().toString());
    }
}